home *** CD-ROM | disk | FTP | other *** search
/ NeXTSTEP 3.3 (Developer)…68k, x86, SPARC, PA-RISC] / NeXTSTEP 3.3 Dev Intel.iso / NextDeveloper / Headers / mach / mig_errors.h < prev    next >
C/C++ Source or Header  |  1995-02-14  |  5KB  |  153 lines

  1. /* 
  2.  * Mach Operating System
  3.  * Copyright (c) 1991,1990,1989,1988,1987 Carnegie Mellon University
  4.  * All Rights Reserved.
  5.  * 
  6.  * Permission to use, copy, modify and distribute this software and its
  7.  * documentation is hereby granted, provided that both the copyright
  8.  * notice and this permission notice appear in all copies of the
  9.  * software, derivative works or modified versions, and any portions
  10.  * thereof, and that both notices appear in supporting documentation.
  11.  * 
  12.  * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
  13.  * CONDITION.  CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR
  14.  * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
  15.  * 
  16.  * Carnegie Mellon requests users of this software to return to
  17.  * 
  18.  *  Software Distribution Coordinator  or  Software.Distribution@CS.CMU.EDU
  19.  *  School of Computer Science
  20.  *  Carnegie Mellon University
  21.  *  Pittsburgh PA 15213-3890
  22.  * 
  23.  * any improvements or extensions that they make and grant Carnegie Mellon
  24.  * the rights to redistribute these changes.
  25.  */
  26. /*
  27.  * HISTORY
  28.  * $Log:    mig_errors.h,v $
  29.  * Revision 2.9  93/01/14  17:44:58  danner
  30.  *     Cleanup.
  31.  *     [92/06/10            pds]
  32.  * 
  33.  * Revision 2.8  92/03/31  15:18:19  rpd
  34.  *     Added MIG_DESTROY_REQUEST.
  35.  *     [92/03/09            rpd]
  36.  * 
  37.  * Revision 2.7  92/01/15  13:44:38  rpd
  38.  *     Changed MACH_IPC_COMPAT conditionals to default to not present.
  39.  * 
  40.  * Revision 2.6  92/01/03  20:21:52  dbg
  41.  *     Add mig_routine_t.
  42.  *     [91/11/11            dbg]
  43.  * 
  44.  * Revision 2.5  91/08/28  11:15:31  jsb
  45.  *     Added MIG_SERVER_DIED.
  46.  *     [91/08/21            rpd]
  47.  * 
  48.  * Revision 2.4  91/05/14  16:56:33  mrt
  49.  *     Correcting copyright
  50.  * 
  51.  * Revision 2.3  91/02/05  17:34:20  mrt
  52.  *     Changed to new Mach copyright
  53.  *     [91/02/01  17:19:44  mrt]
  54.  * 
  55.  * Revision 2.2  90/06/02  14:59:14  rpd
  56.  *     Converted to new IPC.
  57.  *     [90/03/26  22:37:01  rpd]
  58.  * 
  59.  * Revision 2.1  89/08/03  16:03:33  rwd
  60.  * Created.
  61.  * 
  62.  * Revision 2.4  89/02/25  18:38:41  gm0w
  63.  *     Changes for cleanup.
  64.  * 
  65.  * Revision 2.3  89/02/07  01:01:21  mwyoung
  66.  * Relocated from sys/mig_errors.h
  67.  * 
  68.  * Revision 2.2  88/07/20  21:05:51  rpd
  69.  * Added definition of mig_symtab_t.
  70.  * 
  71.  *  2-Dec-87  David Golub (dbg) at Carnegie-Mellon University
  72.  *    Added MIG_ARRAY_TOO_LARGE.
  73.  *
  74.  * 25-May-87  Richard Draves (rpd) at Carnegie-Mellon University
  75.  *    Added definition of death_pill_t.
  76.  *
  77.  * 31-Jul-86  Michael Young (mwyoung) at Carnegie-Mellon University
  78.  *    Created.
  79.  *
  80.  */
  81. /*
  82.  * Mach Interface Generator errors
  83.  *
  84.  */
  85.  
  86. #ifndef    _MACH_MIG_ERRORS_H_
  87. #define _MACH_MIG_ERRORS_H_
  88.  
  89. #include <mach/kern_return.h>
  90. #include <mach/message.h>
  91.  
  92. /*
  93.  *    These error codes should be specified as system 4, subsytem 2.
  94.  *    But alas backwards compatibility makes that impossible.
  95.  *    The problem is old clients of new servers (eg, the kernel)
  96.  *    which get strange large error codes when there is a Mig problem
  97.  *    in the server.  Unfortunately, the IPC system doesn't have
  98.  *    the knowledge to convert the codes in this situation.
  99.  */
  100.  
  101. #define MIG_TYPE_ERROR        -300    /* client type check failure */
  102. #define MIG_REPLY_MISMATCH    -301    /* wrong reply message ID */
  103. #define MIG_REMOTE_ERROR    -302    /* server detected error */
  104. #define MIG_BAD_ID        -303    /* bad request message ID */
  105. #define MIG_BAD_ARGUMENTS    -304    /* server type check failure */
  106. #define MIG_NO_REPLY        -305    /* no reply should be sent */
  107. #define MIG_EXCEPTION        -306    /* server raised exception */
  108. #define MIG_ARRAY_TOO_LARGE    -307    /* array not large enough */
  109. #define MIG_SERVER_DIED        -308    /* server died */
  110. #define MIG_DESTROY_REQUEST    -309    /* destroy request with no reply */
  111.  
  112. typedef struct {
  113.     mach_msg_header_t    Head;
  114.     mach_msg_type_t        RetCodeType;
  115.     kern_return_t        RetCode;
  116. } mig_reply_header_t;
  117.  
  118. typedef struct mig_symtab {
  119.     char    *ms_routine_name;
  120.     int    ms_routine_number;
  121. #if    defined(__STDC__) || defined(c_plus_plus) || defined(hc)
  122.     void
  123. #else
  124.     int
  125. #endif
  126.         (*ms_routine)();
  127. } mig_symtab_t;
  128.  
  129. /*
  130.  * Definition for server stub routines.  These routines
  131.  * unpack the request message, call the server procedure,
  132.  * and pack the reply message.
  133.  */
  134. #if    defined(__STDC__) || defined(c_plus_plus)
  135. typedef    void    (*mig_routine_t)(mach_msg_header_t *, mach_msg_header_t *);
  136. #else
  137. #if    defined(hc)
  138. typedef    void    (*mig_routine_t)();
  139. #else
  140. typedef    int    (*mig_routine_t)();    /* PCC cannot handle void (*)() */
  141. #endif
  142. #endif
  143.  
  144. /* Definitions for the old IPC interface. */
  145.  
  146. typedef struct {
  147.     msg_header_t        Head;
  148.     msg_type_t        RetCodeType;
  149.     kern_return_t        RetCode;
  150. } death_pill_t;
  151.  
  152. #endif    /* _MACH_MIG_ERRORS_H_ */
  153.